<div>
	<yu-panel title="警示模板管理">
		<yu-row :gutter="24">
			<yu-col :span="5">
				<yu-xtree ref="refTree" :height="height" @node-click="nodeClickFn" :data-url="treeDataUrl" data-id="paramCode" data-label="paramName"
				 data-pid="parentId" :data-async="async" :data-params="param" data-root="0000" style="margin:10px 10px 0 0;" icon="iconPath">
				</yu-xtree>
			</yu-col>
			<yu-col :span="19">
				<yu-xform related-table-name="refTable" form-type="search" v-model="searchFormdata" label-width="120px">
					<yu-xform-group :column="3">
						<yu-xform-item label="报警模板名称" placeholder="报警模板名称" ctype="input" name="templateName" ></yu-xform-item>
						<yu-xform-item label="报警方式" placeholder="报警方式" ctype="select" name="alarmMode" data-code="USE_WARNING_MODE"></yu-xform-item>
					</yu-xform-group>
				</yu-xform>
				<yu-toolBar>
					<yu-button @click="addEvent" v-show="addBtnShow" v-if="addFnButton">新增 </yu-button>
					<yu-button @click="changeEvent" v-show="changeBtnShow" v-if="updateFnButton">修改</yu-button>
					<yu-button @click="deleteEvent" v-show="deleteBtnShow" v-if="deleteFnButton">删除</yu-button>
				</yu-toolBar>
				<div ref="tableBox" style="overflow: auto;">
					<yu-xtable :height="tbHeight" ref="refTable"  row-number :data-url="dataUrl" :pageable="true" selection-type="radio" @selection-change="selectEvent">
						<yu-xtable-column label="报警模板名称" :show-overflow-tooltip="true" prop="templateName">
							<template slot-scope="scope">
								<a  class="diandian" style="text-decoration:underline;color:#636CE4 " href="javascipt:void(0);" @click="viewDataFn(scope.row)">{{ scope.row.templateName }}</a>
							</template>
						</yu-xtable-column>
						<yu-xtable-column label="报警分类" :show-overflow-tooltip="true" prop="alarmClass" :options="alarmClassOption"></yu-xtable-column>
						<yu-xtable-column label="报警方式" prop="alarmMode" :options="alarmModeOption"></yu-xtable-column>
						<yu-xtable-column label="模板标题" :show-overflow-tooltip="true" prop="templateTitle"></yu-xtable-column>
						<yu-xtable-column label="日志附件" prop="logFlag" :options="hasLogOption"></yu-xtable-column>
					</yu-xtable>
					</div>
				<yu-xdialog :title="viewTitle" :visible.sync="dialogVisible" width="900px">
					<yu-row>
						<yu-col :span="16">
							<yu-xform class="refFormClass" ref="refForm" v-model="formdata" label-width="120px" :rules="coderules">
								<yu-xform-group>
									<yu-xform-item ctype="input" name="alarmClass" hidden></yu-xform-item>
									<yu-xform-item name="templateCode" label="模板代码"  ctype="input" :disabled="!isAddFlag" colspan="23" maxlength="64"></yu-xform-item>
									<yu-xform-item label="模板名称" ctype="input" name="templateName" rules="required" :readOnly="false" colspan="23" maxlength="120"></yu-xform-item>
									<yu-xform-item label="模板标题" ctype="input" name="templateTitle" rules="required" :readOnly="false" colspan="23" maxlength="120"></yu-xform-item>
									<yu-xform-item label="报警方式" ctype="select" name="alarmMode" rules="required" :disabled="disabledway" colspan="23" :options="alarmModeOption"
									 placeholder="请选择"></yu-xform-item>
									<yu-xform-item label="模板文本" ctype="textarea" name="templateText" rules="required" :readOnly="false" colspan="23"></yu-xform-item>
									<yu-xform-item label="包含日志附件" ctype="select" name="logFlag" rules="required" colspan="23" :options="hasLogOption" placeholder="请选择"></yu-xform-item>
									<yu-xform-item label="备注" ctype="textarea" :rows="3" name="remark" :readOnly="false" colspan="23" maxlength="240"></yu-xform-item>
								</yu-xform-group>
							</yu-xform>
						</yu-col>
						<yu-col :span="8">
							<yu-xtable class="paramRefTableClass" ref="paramRefTable" row-number :data-url="realParamTableDataUrl" max-height="380" :pageable="false">
								<yu-xtable-column label="参数名称" prop="paramName" width="100"></yu-xtable-column>
								<yu-xtable-column label="参数代码" prop="paramCode" width="100"></yu-xtable-column>
							</yu-xtable>
						</yu-col>
					</yu-row>
					<yu-row>
						<div class="yu-grpButton">
							<yu-button v-show="cancelBtnShow" @click="cancelFn">取消</yu-button>
							<yu-button type="primary" v-if="!isView" @click="saveFn" :disabled="isView">保存</yu-button>
							<yu-button type="info" v-if="isView" @click="saveFn" :disabled="isView">保存</yu-button>
						</div>
					</yu-row>
				</yu-xdialog>
			</yu-col>
		</yu-row>
	</yu-panel>
</div>
<style type="text/css">
	.diandian{
		overflow: hidden;
		word-break: break-all;
		box-sizing: border-box;
		text-overflow: ellipsis;
	}
</style>